//时间格式化
function dateFtt(fmt, date) { //author: meizz
    var o = {
        "M+": date.getMonth() + 1,                 //月份
        "d+": date.getDate(),                    //日
        "h+": date.getHours(),                   //小时
        "m+": date.getMinutes(),                 //分
        "s+": date.getSeconds(),                 //秒
        "q+": Math.floor((date.getMonth() + 3) / 3), //季度
        "S": date.getMilliseconds()             //毫秒
    };
    if (/(y+)/.test(fmt))
        fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
    for (var k in o)
        if (new RegExp("(" + k + ")").test(fmt))
            fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
    return fmt;
}

//年与日时间转横杠时间
function date_nyrzhg(mydate) {
    myre = new RegExp('[年月日]', 'g')
    mydate = mydate.replace(myre, '-')
    mydate=Date.parse(mydate)
    mydate=new Date(mydate)
    Y = mydate.getFullYear().toString()
    M = ('0' + (mydate.getMonth() + 1).toString()).slice(-2)
    d = ('0' + mydate.getDate().toString()).slice(-2)
    return Y + '-' + M + '-' + d
}